var express = require('express');
var router = express.Router();

const pool = require('../pool.js')

router.get("/getmenu", (req, res) => {
    var sql = "SELECT * FROM demo_menu;"
    pool.query(sql, (err, result) => {
        if (err) throw err
        res.send(result)
    })
    console.log(`获取菜单数据,时间:  ${new Date().toLocaleString()}`)
})

router.get("/getrouter", (req, res) => {
    var sql = "select * from demo_routers;"
    pool.query(sql, (err, result) => {
        if (err) throw err;
        res.send(result)
    })
    console.log(`获取路由数据,时间:  ${new Date().toLocaleString()}`)
})

module.exports = router;